<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>用户注册</title>
</head>
<body>

<s:form id="registerform" action="../Clientregister" method="post">
	<s:textfield id="client.clientId" label="用户ID" name="client.clientId"></s:textfield>
	<s:textfield id="client.name" label="用户姓名" name="client.name"></s:textfield>
	<s:textfield id="client.idNum" label="身份证号码" name="client.idNum"></s:textfield>
	<s:password id="password" label="密码" name="client.password"></s:password>
	<s:password id="re_password" label="确认密码" name="re_password"></s:password>
	<s:reset value="重置"></s:reset>
	
</s:form>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button onclick="check()">注册</button>

</body>

<script type="text/javascript">
function check() {
	var id = document.getElementById("client.clientId").value;
	var name = document.getElementById("client.name").value;
	var idNum = document.getElementById("client.idNum").value;
	var pw1 = document.getElementById("password").value;
	var pw2 = document.getElementById("re_password").value;
	if (id != "" && name != "" && idNum != "" & pw1 != "" && pw2 != "") {
		
		if (pw1 != pw2) {
		alert("两次输入的密码不一致！");
		document.getElementById("password").value = ""
		document.getElementById("re_password").value = "";
		} else {
		document.getElementById("registerform").submit();
		}
	} else {
		alert("所有信息必须填写完整！");
	}
}
</script>

</html>